package com.ws.sms;

import java.rmi.RemoteException;
import java.util.HashMap;

import javax.xml.rpc.ServiceException;


import com.ws.client.WSProxyUtils;

public class SendSms {
	

	public boolean send(String tel_no,String msg){
		HashMap<String, String> qReq = new HashMap<String, String>();

		qReq.put("TRADE_CODE", "SMS001");
		qReq.put("TRADE_KEY", Format.getRandom());
		qReq.put("TRN_TX_DATE", Format.formatDate());
		qReq.put("TRN_TX_TIME", Format.formatTime());
		qReq.put("TX_MP_MOBILE_NO", tel_no);
		qReq.put("TX_MP_PAY_SMS_DATA", msg);
		try {
			HashMap<String, String> rsq=WSProxyUtils.call(qReq);
			if ("00".equals(rsq.get("MSG_CODE"))){
				return true;
			}
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (ServiceException e) {
			e.printStackTrace();
		}
		return false;
	}

}
